using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;
using Tomahawk.Runtime.Rendering.Objects;
using Tomahawk.Runtime.Scene;

namespace Tomahawk.Runtime.Logic
{
    public abstract class XStaticMeshComponent : XRenderableComponent
    {

        protected XStaticMeshComponent()
        {
            //default priority is: Scene
            this.RenderStage = Engine.RenderingStages.Scene;
        }

        private string meshName;
        
        /// <summary>
        /// Indicates the name of the 3D model that will be used
        /// </summary>
        [XmlElement("MeshName")]
        public string MeshName
        {
            get { return meshName; }
            set { meshName = value; }
        }

        /// <summary>
        /// Interface to render static 3D models
        /// </summary>
        private BasicMesh meshModel;

        /// <summary>
        /// Initialization
        /// </summary>
        protected override void OnInitialize()
        {
            base.OnInitialize();

            meshModel = new BasicMesh(meshName);
            this.SceneNode.Attach(meshModel);

        }

    }

}